// XenMemory.h
#pragma once
#include <sstream>
#include <string>
#include "../ConfigFile.h"
#include "../Utils.h"

using namespace std;

class XenMemory
{
private:
/*	
#define MAXHP_MEMLOC 0x685e1e8 //
#define MAXMP_MEMLOC 0x685e1ea //
#define MAXXP_MEMLOC 0x270475f //Not Used
#define LEVEL_MEMLOC 0x685e1f0 //
#define CURHP_MEMLOC 0x685e1f2 //
#define CURMP_MEMLOC 0x685e1f4 //
#define CURXP_MEMLOC 0x685e6a4 //
#define INGAME_MEMLOC 0x3828c24 //
#define PAGE_MEMLOC 0x51b214 //
#define HPPERCENT_MEMLOC 0x3b85078 //
#define MPPERCENT_MEMLOC 0x10dba74 //
#define XPPERCENT_MEMLOC 0x10d7cf8 //
#define SERVER_MEMLOC 0x1295f64 //Not used anymore
#define FPS_MEMLOC 0x51eec8 //
#define LOCX_MEMLOC 0x49f3fb0 //
#define LOCY_MEMLOC 0x1585e98 //
#define MONEY_MEMLOC 0x685e6a8 //
#define CURLIGHT_MEMLOC 0x136ab40 //
	*/

	HANDLE xenimusProcess;
	DWORD GetProcId(char * procName);
	byte ReadMemLocByte(int address);
	int ReadMemLocInt(int address);
	unsigned short ReadMemLocUShort(int address);
	void WriteMemLocInt(int address, int value);
	string ReadMemLocString(int address, int size);
	void WriteMemLocShort(int address, short value);

public:
	XenMemory();
	XenMemory(HANDLE xenimusProcess);
	unsigned int ReadMemLocUInt(int address);
	short ReadClickCounter();
	void WriteClickCounter(short value);
	short ReadPID();
	float ReadHPPercent();
	float ReadMPPercent();
	float ReadXPPercent();
	short ReadMaxHP();
	short ReadMaxMP();
	int ReadMaxXP();
	byte ReadLevel();
	int ReadCurrentXP();
	byte ReadViewVar();
	byte ReadInGameVar();
	byte ReadPage();
	byte ReadServer();
	byte ReadInChat();
	int ReadFPS();
	int ReadMoney();
	byte ReadCurrentLight();
	int ReadLocX();
	int ReadLocY();
	void WriteLocX(int value);
	void WriteLocY(int value);
};